Rules Based Machining